﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using System.Web.Mvc;

namespace Mindfor.Web.Modules.Users
{
	/// <summary>
	/// Cotnains data to change user properties.
	/// </summary>
	public class UserChangeModel
	{
		/// <summary>
		/// Gets or sets user login.
		/// </summary>
		[DisplayName("Логин")]
		[StringLength(255, ErrorMessage="Логин должен быть не длиннее 255 символов")]
		public string Login { get; set; }

		/// <summary>
		/// Gets or sets user e-mail.
		/// </summary>
		[DisplayName("E-mail")]
		[StringLength(255, ErrorMessage="E-mail должен быть не длиннее 255 символов")]
		[RegularExpression(RegexConsts.EmailRegex, ErrorMessage="Введите корректный e-mail")]
		public string Email { get; set; }

		/// <summary>
		/// Gets or sets user current password.
		/// </summary>
		[DisplayName("Текущий пароль")]
		public string Pwd { get; set; }

		/// <summary>
		/// Gets or sets user new password.
		/// </summary>
		[DisplayName("Новый пароль")]
		public string NewPwd { get; set; }

		/// <summary>
		/// Gets or sets user new password confirmation.
		/// </summary>
		[DisplayName("Повтор пароля")]
		[Compare("NewPwd", ErrorMessage="Повтор пароля не совпадает с новым паролем")]
		public string ConfirmNewPwd { get; set; }
	}
}
